﻿#include "FITKAbaAbstractBoundaryCondition.h"
#include "FITK_Interface/FITKInterfacePhysics/FITKAbstractFields.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Interface {

    bool FITKAbaAbstractBoundaryCondition::hasGetStepManager()
    {
        if (m_stepManager != nullptr)
            return true;
        m_stepManager = this->getStepManager(this);
        if (m_stepManager == nullptr)
            return false;
        return true;
    }

    bool FITKAbaAbstractBoundaryCondition::copy(Core::FITKAbstractDataObject* obj)
    {
        FITKAbaAbstractBoundaryCondition* bound = dynamic_cast<FITKAbaAbstractBoundaryCondition*>(obj);
        if (bound == nullptr)
            return false;
        this->_modelID = bound->_modelID;
        this->_componentID = bound->_componentID;
        this->m_createdStepId = bound->m_createdStepId;
        this->m_deactiveStepId = bound->m_deactiveStepId;
        this->m_activeState = bound->m_activeState;
        return true;
    }

    bool FITKAbaAbstractBoundaryCondition::getActiveState() const
    {
        return m_activeState;
    }

    void FITKAbaAbstractBoundaryCondition::setActiveState(bool stat)
    {
        m_activeState = stat;
    }

    void FITKAbaAbstractBoundaryCondition::setFieldID(const int id)
    {
        _fieldID = id;
    }

    Interface::FITKAbstractFiled* FITKAbaAbstractBoundaryCondition::getField()
    {
        return FITKDATAREPO->getTDataByID<FITKAbstractFiled>(_fieldID);
    }

}
